import dataApi from '@/view/v/data-api'
import getUrlSearch from '@/modules/corejs/url/get-url-search'
import scriptLoad from '@/modules/corejs/dom/script-load'
import coreDataCompatible from '@/view/v/core-data-compatible.js'
export default function () {
  let id = getUrlSearch('id')
  if (id) {
    window.jsonp_transmit = function (d) {
      // dataApi.core = JSON.parse(d.templateUrl)
      dataApi.core = coreDataCompatible(d)
    }
    scriptLoad('./data/' + id + '.js')
  } else {
    console.error('失败，id 不存在')
  }
}
